package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DishFlavorMapper {
//    @AutoFill(OperationType.INSERT) //由于dish_flavor表中没有公共字段,因此不需要通过AOP技术填充公共字段
    Integer insert(DishFlavor dishFlavor);

    void update(DishFlavor flavor);

    /**
     * 批量update,需要在连接mysql的url上加 &allowMultiQueries=true
     * @param flavors
     */
    void updateInBatches(List<DishFlavor> flavors);

    List<DishFlavor> selectByDishId(Long id);

    void insertInBatches(List<DishFlavor> flavors);

    void deleteByDishId(Integer[] ids);
}